package org.senseframework.support.example.mybatis.domain;

import org.senseframework.support.orm.mybatis.annotations.Column;
import org.senseframework.support.orm.mybatis.annotations.Table;
import org.senseframework.support.orm.mybatis.definition.JoinType;


/**
 * Created by emeey on 2016/11/20.
 */

/**
 *basesql: select fileds from user
 *basesql: select fileds from user as a left join b as b on a.aid=b.bid;
 * 两表或者 > 两表？
 * >两表
 * basesql=driver table ？:select c.id as id ,c.a as a,a.c as c from c  left join （select * from a left join b on a.id=b.id） as ab on ad.id=c.id
 * basesqlcount:select count(1) from c  left join （select * from a left join b on a.id=b.id） as ab on ad.id=c.id
 * driver table
 */
//@Table(sql = "from user as c join user_b as b on b.id=c.id")
@Table(table = "user",tableAs = "a",joinTable = "user_b",joinTableAs = "c",joinType = JoinType.left,tableOn = "id",joinTableOn = "id")
//@Table(table = "user_info",tableAs = "a",joinTable = "usera",)
public class User extends Basic{

    @Column(column = "account",tableAs = "c")
    private String account;
    @Column(column = "username",tableAs = "b")
    private String nickname;
    @Column(transfer = false)
    private Integer age;
    @Column
    private String phone;
    @Column
    private String passwd;

    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
}
